package com.shop.publics.controller;

import com.shop.common.response.ExceptionResponse;
import com.shop.publics.service.CarouselService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("public")
public class IndexController {
    @Autowired
    private CarouselService carouselService;
     @GetMapping("carousel")
    public ResponseEntity<?> carousel() {
         return ResponseEntity.ok( ExceptionResponse.Success(carouselService.findAll()) );
     }
}
